﻿using MyTest;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class EventHandler : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Bank bank = new Bank();
        //注册事件
        bank.ProcessTran += SendEmail;
        bank.ProcessTran += SendSMS;
        bank.Process(sender, e);
    }

    private void SendEmail(object sender, EventArgs e)
    {
        Response.Write("发送电子邮件<br>");
    }
    private void SendSMS(object sender, EventArgs e)
    {
        Response.Write("发送短消息<br>");
    }
    protected void Button1_Click(object sender, EventArgs e)
    {

    }
}